<!--
 * @Author: your name
 * @Date: 2020-03-12 16:29:50
 * @LastEditTime: 2020-03-28 10:00:30
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \smart-community\src\views\integral\integralCut.vue
 -->
<template>
  <div class="integralCut">
    <van-nav-bar title="详情" left-arrow @click-left="$router.go(-1)" fixed />
    <div class="integralDeclare-body">
      <van-cell title="申报时间" :value="record_list.creationDate" />
      <van-cell title="当事人姓名" :value="record_list.applyUserName" />
      <van-cell title="当事人身份" :value="record_list.applyIdentityName" />
      <!-- source为3 此处还没有兑换商品 待完善 -->
      <van-cell title="兑换物品:">
        <template slot="label">
          <div style="display:flex;justify-content: center;align-items: center">
            <van-image width="100" height="100" :src="record_list.image" @click="seeImg" />
            <span style="margin-left:220px;">X1</span>
          </div>
        </template>
      </van-cell>
      <div class="integralDeclare-img"></div>
      <div class="van-cell van-panel__header">
        <div class="van-cell__title">
          <span>{{ record_list.content }}</span>
          <div class="van-cell__label">{{ record_list.creationDate }}</div>
        </div>
        <div
          class="van-cell__value van-panel__header-value"
          v-if="record_list.mode == 1 "
        >+{{ record_list.changeValue ? record_list.changeValue : 0 }}</div>
        <div
          class="van-cell__value van-panel__header-value"
          v-if=" record_list.mode == 2 "
        >-{{ record_list.changeValue ? record_list.changeValue : 0 }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import integral from "../../controller/integral";
import { ImagePreview } from "vant";
export default {
  data() {
    return {
      record_list: {}
    };
  },
  mounted() {
    this.integral_record_list_detatil();
  },
  methods: {
    seeImg() {
      ImagePreview({
        images: [this.record_list.image]
      });
    },
    integral_record_list_detatil() {
      let id = this.$route.params.id;
      this.$toast.loading({
        message: "加载中...",
        forbidClick: true,
        loadingType: "spinner"
      });
      integral.integral_record_list_detatil(id).then(res => {
        if (res.code === "0") {
          if (res.datas) {
            this.record_list = res.datas;
            this.$toast.clear();
          }
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.integralCut {
  background: #fff;
  .van-cell__label {
    word-break: break-word;
  }
  .integralDeclare-img {
    padding: 20px;
  }
}
</style>
